package com.demo.main;

import com.alibaba.fastjson.JSON;

import java.io.FileInputStream;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.concurrent.locks.ReentrantLock;

/**
 * Created on 2016/9/12.
 */

class Main {
    public static void main(String[] args) throws Exception {
        String file = "D:/tmp/t.txt";
        Scanner scanner = new Scanner(new FileInputStream(file));
        StringBuilder stringBuilder = new StringBuilder();
        while (scanner.hasNext()) {
            stringBuilder.append("gunzip -cd   ***.gz  |grep \"" + scanner.next() + "\"  >> /tmp/x.txt");
            stringBuilder.append("\n");
            stringBuilder.append("echo  \"\" >> /tmp/x.txt");
            stringBuilder.append("\n");
        }
        System.out.println("stringBuilder = " + stringBuilder);
        scanner.close();
    }
}
